import request from '@/config/axios'

// 告警日志 VO
export interface WarnLogVO {
  id: number // ID
  warnName: string // 告警信息
  warnDetail: string // 告警内容
  ipAddress: string // 告警来源
  warnTime: Date // 告警时间
}

// 告警日志 API
export const WarnLogApi = {
  // 查询告警日志分页
  getWarnLogPage: async (params: any) => {
    return await request.get({ url: `/security/warn-log/page`, params })
  },

  // 查询告警日志详情
  getWarnLog: async (id: number) => {
    return await request.get({ url: `/security/warn-log/get?id=` + id })
  },

  // 新增告警日志
  createWarnLog: async (data: WarnLogVO) => {
    return await request.post({ url: `/security/warn-log/create`, data })
  },

  // 修改告警日志
  updateWarnLog: async (data: WarnLogVO) => {
    return await request.put({ url: `/security/warn-log/update`, data })
  },

  // 删除告警日志
  deleteWarnLog: async (id: number) => {
    return await request.delete({ url: `/security/warn-log/delete?id=` + id })
  },

  // 导出告警日志 Excel
  exportWarnLog: async (params) => {
    return await request.download({ url: `/security/warn-log/export-excel`, params })
  },
}